Skip to content

Conversation

@strailov
Copy link
Contributor

Multi-Assignments feature removal

Removed all DMF related events - MultiActionAssignEven, MultiActionEvent, MultiActionCancelEvent (also related service events).
Renaming MultiAssignmentIsNotEnabledException to MultiAssignmentException (Thrown when multi-assignment is attampted in a single DeploymentRequest) .
Adapting tests accordingly.

Signed-off-by: strailov <Stanislav.Trailov@bosch.io>
Signed-off-by: strailov <Stanislav.Trailov@bosch.io>
@sonarqubecloud
Copy link

Copy link
Contributor

@avgustinmm avgustinmm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but since bigger commit - better have at least one more review

"hawkbit.server.error.repo.tenantConfigurationValueChangeNotAllowed",
"The requested tenant configuration value modification is not allowed."),
SP_MULTIASSIGNMENT_NOT_ENABLED(
SP_MULTIASSIGNMENT(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this now removed ?
"The requested operation requires multi assignment to be enabled" is not valid error anymore ?

private final SoftwareModuleManagement<? extends SoftwareModule> softwareModuleManagement;
private final DistributionSetManagement<? extends DistributionSet> distributionSetManagement;
private final DeploymentManagement deploymentManagement;
private final RepositoryProperties repositoryProperties;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RepositoryProperties not used anymore - was used for getActionWeight that is now removed

private int getWeightConsideringDefault(final Action action) { return action.getWeight().orElse(repositoryProperties.getActionWeightIfAbsent()); }

import static org.eclipse.hawkbit.repository.model.Action.ActionType.DOWNLOAD_ONLY;
import static org.eclipse.hawkbit.repository.model.Action.ActionType.FORCED;

import java.util.AbstractMap.SimpleEntry;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

many unused imports after removals

*/
@Test
void getRollout() throws Exception {
enableMultiAssignments();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strange why it was needed

final boolean bypassWeightEnforcement = true;
final boolean multiAssignmentsEnabled = TenantConfigHelper.isMultiAssignmentsEnabled();
if (!bypassWeightEnforcement && multiAssignmentsEnabled && hasNoWeight) {
if (!bypassWeightEnforcement && hasNoWeight) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this always false ?
bypassWeightEnforcment = true
if(!bypassWeightEnforcment && ..

It seems this validateWeight was used only when multiAssignemntEnabled= true ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and hasWeight is actually not used ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to revise but it seems this was only needed when multiassignment was enabled, otherwise not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants